package com.dkm.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.dkm.entity.DynamicMessage;

public interface DynamicMessageRepository extends JpaRepository<DynamicMessage, Integer>,JpaSpecificationExecutor<DynamicMessage> {

	/**
	 * 获取用户未读消息
	 * @param login_name
	 * @return
	 */
	@Query(value = "from DynamicMessage where recipient=:recipient and is_read='否'")
	List<DynamicMessage> getUnreadDynamicMessage(@Param("recipient")String login_name);
}
